/*************************************************************************
 * @file: kev.h
 * @date: 01/04/2012
 * TOPOL v1_0 - (c)copyright 2012 TEC/UFF
 *************************************************************************
 * This is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 ************************************************************************/

#ifndef _KEV
#define _KEV

// includes
//----------
#include "euleroperator.h"

// forward declarations
//----------------------
class HalfEdge;
class HEDModel;


/*!
 * CLASS
 * KEV
 * 
 * This class implements the Topological Euler Operator: KEV, that means,
 * Kill Edge and Vertex.
 * 
 * @author Andre Pereira (andremaues@id.uff.br)
 * @version 1.0.0
 * @see EulerOperator
 */
class KEV : public EulerOperator
{

public:

  ////////////////////////////////////////////////
  ///  Constructor and Destructor Declaration  ///
  ////////////////////////////////////////////////

  /**
   * @brief Creates the Topological Euler Operator MEV
   *        OBS: It corresponds to the kev of Mantyla.
   * @param _model is the model with all topological data
   * @param _s is the identity of the solid that the topological entities are removed
   * @param _f is the identity of the face where the edge lies in
   * @param _v1 is the identity of the kept vertex
   * @param _v2 is the identity of the vertex to be removed
   */
  KEV( HEDModel& _model, int _s, int _f, int _v1, int _v2 );

  /**
   * @brief Creates the Topological Euler Operator MEV
   *        OBS: It corresponds to the lkev of Mantyla.
   * @param _he1 is the first half-edge of the edge to be killed
   * @param _he2 is the second half-edge of the edge to be killed
   */
  KEV( HalfEdge* _he1, HalfEdge* _he2 );

  ////////////////////////////////////
  ///  PUBLIC Methods Declaration  ///
  ////////////////////////////////////
		
  /**
   * @brief Asks to execute the current topological operator
   */
  void execute();
		
  /**
   * @brief Asks to execute the inverse topological operator
   */
  void unExecute();


private:

  ////////////////////////////////
  ///  Attributes Declaration  ///
  ////////////////////////////////

  /** @brief Is the first half-edge of the edge to be killed */
  HalfEdge* m_he1;

  /** @brief Is the second half-edge of the edge to be killed */
  HalfEdge* m_he2;

};

#endif
